Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add server mode #27

Merged
merged 11 commits into from
Oct 2, 2018
Merged

Add server mode #27

merged 11 commits into from
Oct 2, 2018

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Oct 2, 2018

This PR will add server mode provided by --server (-s) option. It would apply the on-demand conversion to the served markdown files.

Server mode recognizes a directory passed by --input-dir option to keep structure.

marp -s --input-dir slide

If you have a markdown in ./slide/markdown.md, you can trigger the on-demand conversion by accessing to http://localhost:8080/markdown.md or http://localhost:8080/markdown.html.

To provide the user-friendly CLI interface, an inputed argument treats as the input directory even without --input-dir (-I) option when there is --server (-s) option. Thus, the below command would work as same too.

marp -s slide

The default port number is 8080. It could change by PORT environment variable as same as many server programs.

Docker

docker run --rm --init -v $PWD:/home/marp/app/ -p 8080:8080 -p 52000:52000 marpteam/marp-cli -s slide

Related to yhatt/marp#232.

ToDo

  • Add tests

@yhatt yhatt changed the title [WIP] Add server mode Add server mode Oct 2, 2018
@yhatt yhatt merged commit ff2c491 into master Oct 2, 2018
@yhatt yhatt deleted the server-mode-2 branch October 2, 2018 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant